package com.pan.excep.error;

import com.pan.excep.enume.ErrorCode;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class ServiceException extends RuntimeException{

    Integer code;

    String message;

    public ServiceException(ErrorCode errorCode){
        code = errorCode.getCode();
        message = errorCode.getMessage();
    }
}
